package com.fjnu.dao.impl;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.fjnu.dao.IAdministratorDao;
import com.fjnu.dao.common.BaseDaoImpl;
import com.fjnu.entities.Administrator;
@Repository
public class AdministratorDao extends BaseDaoImpl<Administrator> implements IAdministratorDao{
	
	public void addAdmin(Administrator administrator) {
		
		save(administrator);
	}

	
	public void delAdmin(int id) {
		delete(id);
		
	}


	@SuppressWarnings("unchecked")
	public List<Administrator> findAllAdmin(Integer pageNo,Integer pageSize) {
		String hql="from Administrator";
		List<Administrator> list = queryPage(hql, pageNo, pageSize);
		return list;
	}

	
	public void updateAdmin(Administrator administrator) {
		
		update(administrator);
	}

}
